import request from '@/utils/request'

// 商品
// 列表
export function get_goods_list(params) {
  return request({
    url: '/goods/admin_get_goods_list',
    method: 'get',
    params: params,
  })
}
// 获取商品详情
export function get_goods_detail(params) {
  return request({
    url: '/goods/admin_get_goods_detail',
    method: 'get',
    params: params,
  })
}
// 添加商品
export function add_goods(data) {
  return request({
    url: '/goods/admin_add_goods',
    method: 'post',
    data,
  })
}
// 修改商品
export function edit_goods(data) {
  return request({
    url: '/goods/admin_edit_goods',
    method: 'post',
    data,
  })
}
// 删除商品
export function delete_goods(data) {
  return request({
    url: '/goods/admin_delete_goods',
    method: 'post',
    data,
  })
}
// 上下架商品
export function shelf_goods(data) {
  return request({
    url: '/goods/admin_shelf_goods',
    method: 'post',
    data,
  })
}

// 商品规格
// 列表
export function get_goods_specification(params) {
  return request({
    url: '/specification/admin_get_specification_list',
    method: 'get',
    params: params,
  })
}
// 添加
export function add_goods_specification(data) {
  return request({
    url: '/specification/admin_add_specification_list',
    method: 'post',
    data: data,
  })
}
// 修改
export function edit_goods_specification(data) {
  return request({
    url: '/specification/admin_edit_specification_list',
    method: 'post',
    data: data,
  })
}
// 删除
export function delete_specification_list(data) {
  return request({
    url: '/specification/admin_delete_specification_list',
    method: 'post',
    data: data,
  })
}

// 根据商品规格id获取商品规格列表
export function ids_get_specification_list(data) {
  return request({
    url: '/specification/ids_get_specification_list',
    method: 'post',
    data: data,
  })
}
